# create a new koji builder on raw hw
# NOTE: should be used with --limit most of the time
# NOTE: most of these vars_path come from group_vars/buildhw or from hostvars

- name: make koji builder(s) on raw hw
  hosts: buildhw;buildppc;buildarm:bkernel
  user: root
  gather_facts: True

  vars_files: 
   - /srv/web/infra/ansible/vars/global.yml
   - "{{ private }}/vars.yml"
   - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml

  roles:
  - base
  - { role: nfs/client, when: inventory_hostname.startswith('build') , mnt_dir: '/mnt/fedora_koji',  nfs_src_dir: 'fedora_koji' }
  - koji_builder
  - { role: bkernel, when: inventory_hostname.startswith('bkernel') }
  - hosts

  tasks:
  - include: "{{ tasks }}/yumrepos.yml"

  handlers:
  - include: "{{ handlers }}/restart_services.yml"
